using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Decisions.HL7.Message;
using DecisionsFramework;

namespace Decisions.HL7.Message
{
    public class DegreeLicenseCertificateAttribute:RuleAttribute
    {
        private Dictionary<HL7Version, string[]> validVersionCodes = new Dictionary<HL7Version, string[]>();
        private Dictionary<HL7Version, string[]> validVersionDescriptions = new Dictionary<HL7Version, string[]>();
        private Dictionary<HL7Version, HL7TableType> tableVersionTypes = new Dictionary<HL7Version, HL7TableType>();

        public DegreeLicenseCertificateAttribute()
        {
            // init the values for table version types
						tableVersionTypes[HL7Version.v231] = HL7TableType.User;
						tableVersionTypes[HL7Version.v24] = HL7TableType.User;
						tableVersionTypes[HL7Version.v25] = HL7TableType.User;
						tableVersionTypes[HL7Version.v251] = HL7TableType.User;
						tableVersionTypes[HL7Version.v26] = HL7TableType.User;
						tableVersionTypes[HL7Version.v27] = HL7TableType.User;
			
            
			// init the values for version codes
						validVersionCodes[HL7Version.v231] = new string[]{"AAS","AA","ABA","AE","AS","BA","BBA","BE","BFA","BN","BS","BSL","BT","CER","DIP","DBA","DED","PHE","PHD","PHS","MD","DO","HS","JD","MA","MBA","MCE","MDI","MED","MEE","ME","MFA","MME","MS","MSL","MT","NG","SEC","TS"};
						validVersionCodes[HL7Version.v24] = new string[]{"AAS","AA","ABA","AE","AS","BA","BBA","BE","BFA","BN","BS","BSL","BT","CER","DIP","DBA","DED","PharmD","PHE","PHD","PHS","MD","DO","HS","JD","MA","MBA","MCE","MDI","MED","MEE","ME","MFA","MME","MS","MSL","MT","NG","SEC","TS"};
						validVersionCodes[HL7Version.v25] = new string[]{"PN","AAS","AA","ABA","AE","AS","BA","BBA","BE","BFA","BN","BS","BSL","BSN","BT","CER","CANP","CMA","CNP","CNM","CRN","CNS","CPNP","DIP","DBA","DED","PharmD","PHE","PHD","PHS","MD","DO","EMT","EMTP","FPNP","HS","JD","MA","MBA","MCE","MDI","MED","MEE","ME","MFA","MME","MS","MSL","MSN","MT","MDA","NG","NP","PA","RMA","RPH","SEC","TS"};
						validVersionCodes[HL7Version.v251] = new string[]{"PN","AAS","AA","ABA","AE","AS","BA","BBA","BE","BFA","BN","BS","BSL","BSN","BT","CER","CANP","CMA","CNP","CNM","CRN","CNS","CPNP","DIP","DBA","DED","PharmD","PHE","PHD","PHS","MD","DO","EMT","EMTP","FPNP","HS","JD","MA","MBA","MCE","MDI","MED","MEE","ME","MFA","MME","MS","MSL","MSN","MT","MDA","NG","NP","PA","RMA","RPH","SEC","TS"};
						validVersionCodes[HL7Version.v26] = new string[]{"PN","AAS","AA","ABA","AE","AS","BA","BBA","BE","BFA","BN","BS","BSL","BSN","BT","CER","CANP","CMA","CNP","CNM","CRN","CNS","CPNP","DIP","DBA","DED","PharmD","PHE","PHD","PHS","MD","DO","EMT","EMTP","FPNP","HS","JD","MA","MBA","MCE","MDI","MED","MEE","ME","MFA","MME","MS","MSL","MSN","MT","MDA","NG","NP","PA","RMA","RPH","SEC","TS"};
						validVersionCodes[HL7Version.v27] = new string[]{"PN","AAS","AA","ABA","AE","AS","BA","BBA","BE","BFA","BN","BS","BSL","BSN","BT","CER","CANP","CMA","CNP","CNM","CRN","CNS","CPNP","DIP","DBA","DED","PharmD","PHE","PHD","PHS","MD","DO","EMT","EMTP","FPNP","HS","JD","MA","MBA","MCE","MDI","MED","MEE","ME","MFA","MME","MS","MSL","MSN","MTH","MDA","MT","NG","NP","PA","RMA","RN","RPH","SEC","TS"};
			
			// init the values for version descriptions
						validVersionDescriptions[HL7Version.v231] = new string[]{"Associate of Applied Science","Associate of Arts","Associate of Business Administration","Associate of Engineering","Associate of Science","Bachelor of Arts","Bachelor of Business Administration","Bachelor or Engineering","Bachelor of Fine Arts","Bachelor of Nursing","Bachelor of Science","Bachelor of Science – Law","Bachelor of Theology","Certificate","Diploma","Doctor of Business Administration","Doctor of Education","Doctor of Engineering","Doctor of Philosophy","Doctor of Science","Doctor of Medicine","Doctor of Osteopathy","High School Graduate","Juris Doctor","Master of Arts","Master of Business Administration","Master of Civil Engineering","Master of Divinity","Master of Education","Master of Electrical Engineering","Master of Engineering","Master of Fine Arts","Master of Mechanical Engineering","Master of Science","Master of Science – Law","Master of Theology","Non-Graduate","Secretarial Certificate","Trade School Graduate"};
						validVersionDescriptions[HL7Version.v24] = new string[]{"Associate of Applied Science","Associate of Arts","Associate of Business Administration","Associate of Engineering","Associate of Science","Bachelor of Arts","Bachelor of Business Administration","Bachelor or Engineering","Bachelor of Fine Arts","Bachelor of Nursing","Bachelor of Science","Bachelor of Science - Law","Bachelor of Theology","Certificate","Diploma","Doctor of Business Administration","Doctor of Education","Doctor of Pharmacy","Doctor of Engineering","Doctor of Philosophy","Doctor of Science","Doctor of Medicine","Doctor of Osteopathy","High School Graduate","Juris Doctor","Master of Arts","Master of Business Administration","Master of Civil Engineering","Master of Divinity","Master of Education","Master of Electrical Engineering","Master of Engineering","Master of Fine Arts","Master of Mechanical Engineering","Master of Science","Master of Science - Law","Master of Theology","Non-Graduate","Secretarial Certificate","Trade School Graduate"};
						validVersionDescriptions[HL7Version.v25] = new string[]{"Advanced Practice Nurse","Associate of Applied Science","Associate of Arts","Associate of Business Administration","Associate of Engineering","Associate of Science","Bachelor of Arts","Bachelor of Business Administration","Bachelor or Engineering","Bachelor of Fine Arts","Bachelor of Nursing","Bachelor of Science","Bachelor of Science - Law","Bachelor on Science - Nursing","Bachelor of Theology","Certificate","Certified Adult Nurse Practitioner","Certified Medical Assistant","Certified Nurse Practitioner","Certified Nurse Midwife","Certified Registered Nurse","Certified Nurse Specialist","Certified Pediatric Nurse Practitioner","Diploma","Doctor of Business Administration","Doctor of Education","Doctor of Pharmacy","Doctor of Engineering","Doctor of Philosophy","Doctor of Science","Doctor of Medicine","Doctor of Osteopathy","Emergency Medical Technician","Emergency Medical Technician - Paramedic","Family Practice Nurse Practitioner","High School Graduate","Juris Doctor","Master of Arts","Master of Business Administration","Master of Civil Engineering","Master of Divinity","Master of Education","Master of Electrical Engineering","Master of Engineering","Master of Fine Arts","Master of Mechanical Engineering","Master of Science","Master of Science - Law","Master of Science - Nursing","Master of Theology","Medical Assistant","Non-Graduate","Nurse Practitioner","Physician Assistant","Registered Medical Assistant","Registered Pharmacist","Secretarial Certificate","Trade School Graduate"};
						validVersionDescriptions[HL7Version.v251] = new string[]{"Advanced Practice Nurse","Associate of Applied Science","Associate of Arts","Associate of Business Administration","Associate of Engineering","Associate of Science","Bachelor of Arts","Bachelor of Business Administration","Bachelor or Engineering","Bachelor of Fine Arts","Bachelor of Nursing","Bachelor of Science","Bachelor of Science - Law","Bachelor on Science - Nursing","Bachelor of Theology","Certificate","Certified Adult Nurse Practitioner","Certified Medical Assistant","Certified Nurse Practitioner","Certified Nurse Midwife","Certified Registered Nurse","Certified Nurse Specialist","Certified Pediatric Nurse Practitioner","Diploma","Doctor of Business Administration","Doctor of Education","Doctor of Pharmacy","Doctor of Engineering","Doctor of Philosophy","Doctor of Science","Doctor of Medicine","Doctor of Osteopathy","Emergency Medical Technician","Emergency Medical Technician - Paramedic","Family Practice Nurse Practitioner","High School Graduate","Juris Doctor","Master of Arts","Master of Business Administration","Master of Civil Engineering","Master of Divinity","Master of Education","Master of Electrical Engineering","Master of Engineering","Master of Fine Arts","Master of Mechanical Engineering","Master of Science","Master of Science - Law","Master of Science - Nursing","Master of Theology","Medical Assistant","Non-Graduate","Nurse Practitioner","Physician Assistant","Registered Medical Assistant","Registered Pharmacist","Secretarial Certificate","Trade School Graduate"};
						validVersionDescriptions[HL7Version.v26] = new string[]{"Advanced Practice Nurse","Associate of Applied Science","Associate of Arts","Associate of Business Administration","Associate of Engineering","Associate of Science","Bachelor of Arts","Bachelor of Business Administration","Bachelor or Engineering","Bachelor of Fine Arts","Bachelor of Nursing","Bachelor of Science","Bachelor of Science - Law","Bachelor on Science - Nursing","Bachelor of Theology","Certificate","Certified Adult Nurse Practitioner","Certified Medical Assistant","Certified Nurse Practitioner","Certified Nurse Midwife","Certified Registered Nurse","Certified Nurse Specialist","Certified Pediatric Nurse Practitioner","Diploma","Doctor of Business Administration","Doctor of Education","Doctor of Pharmacy","Doctor of Engineering","Doctor of Philosophy","Doctor of Science","Doctor of Medicine","Doctor of Osteopathy","Emergency Medical Technician","Emergency Medical Technician - Paramedic","Family Practice Nurse Practitioner","High School Graduate","Juris Doctor","Master of Arts","Master of Business Administration","Master of Civil Engineering","Master of Divinity","Master of Education","Master of Electrical Engineering","Master of Engineering","Master of Fine Arts","Master of Mechanical Engineering","Master of Science","Master of Science - Law","Master of Science - Nursing","Master of Theology","Medical Assistant","Non-Graduate","Nurse Practitioner","Physician Assistant","Registered Medical Assistant","Registered Pharmacist","Secretarial Certificate","Trade School Graduate"};
						validVersionDescriptions[HL7Version.v27] = new string[]{"Advanced Practice Nurse","Associate of Applied Science","Associate of Arts","Associate of Business Administration","Associate of Engineering","Associate of Science","Bachelor of Arts","Bachelor of Business Administration","Bachelor or Engineering","Bachelor of Fine Arts","Bachelor of Nursing","Bachelor of Science","Bachelor of Science - Law","Bachelor on Science - Nursing","Bachelor of Theology","Certificate","Certified Adult Nurse Practitioner","Certified Medical Assistant","Certified Nurse Practitioner","Certified Nurse Midwife","Certified Registered Nurse","Certified Nurse Specialist","Certified Pediatric Nurse Practitioner","Diploma","Doctor of Business Administration","Doctor of Education","Doctor of Pharmacy","Doctor of Engineering","Doctor of Philosophy","Doctor of Science","Doctor of Medicine","Doctor of Osteopathy","Emergency Medical Technician","Emergency Medical Technician - Paramedic","Family Practice Nurse Practitioner","High School Graduate","Juris Doctor","Master of Arts","Master of Business Administration","Master of Civil Engineering","Master of Divinity","Master of Education","Master of Electrical Engineering","Master of Engineering","Master of Fine Arts","Master of Mechanical Engineering","Master of Science","Master of Science - Law","Master of Science - Nursing","Master of Theology","Medical Assistant","Medical Technician","Non-Graduate","Nurse Practitioner","Physician Assistant","Registered Medical Assistant","Registered Nurse","Registered Pharmacist","Secretarial Certificate","Trade School Graduate"};
			            

        }

        
        public override ValidationIssue[] RunRule(string name, object owningObject, object value)
        {
            //todo: check if the value is valid in the current version
            //if the value is not valid in the current version, add it as a validation issue


            return new ValidationIssue[0];
        }
    }
}
